package gameEngine.agents.teamMateModel;

import java.util.ArrayList;
import gameEngine.agents.Agent;
import gameEngine.agents.teamMateModel.EnumOfTeamateModel.Teammate_Meodel_Type;
import org.apache.log4j.Logger;
/**
 * factory to create {@link TeamMateModel}
 * @author alon
 *
 */
public class TeamMateModelFactory {
	static Logger log = Logger.getLogger(gameEngine.agents.Logger.Massages.MassageFactory.class);
	
	/**
	 * create a {@link TeamMateModel} by Type
	 * @param type {@link Teammate_Meodel_Type} enum
	 * @param myId creating agent id as we should know who in the model is us
	 * @param agents list of all agents
	 * @return {@link TeamMateModel} by type
	 */
	public static TeamMateModel create(Teammate_Meodel_Type type,int myId,ArrayList<Agent> agents){
		switch(type){
		case INIT_RANDOM_MODEL:{
			log.debug("InitRandomModel created");
			InitRandomModel model= new InitRandomModel(myId);
			model.init(agents);
			return model;}
		case INIT_0_MODEL:{
			log.debug("Init0Model created");
			Init0Model model= new Init0Model(myId);
			model.init(agents);
			return model;}	
		
		case INIT_TRUE_MODEL:{
			log.debug("InitTrueModel created");
			InitTrueModel model= new InitTrueModel(myId);
			model.init(agents);
			return model;}	
		}
		log.debug("no model match for type "+type+"return Init0Model");
		Init0Model model= new Init0Model(myId);
		model.init(agents);
		return model;
	}
}
